<template>
  <div class="rights">
     <el-row>
      <el-col :span="24">
        <el-breadcrumb separator="/">
          <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
          <el-breadcrumb-item><a href="/">用户管理</a></el-breadcrumb-item>
          <el-breadcrumb-item>用户列表</el-breadcrumb-item>
        </el-breadcrumb>
      </el-col>
    </el-row>
    <el-table
      :data="rightList"
      border
      style="width: 100%">
       <el-table-column
        type="index"
        width="50">
      </el-table-column>
      <el-table-column
        prop="authName"
        label="权限名称"
        width="180">
      </el-table-column>
      <el-table-column
        prop="path"
        label="路径">
      </el-table-column>
      <el-table-column label="层级">
      <template slot-scope="scope">
        <span>{{scope.row.level|fmtLevel}}</span>
      </template>
    </el-table-column>
    </el-table>
  </div>
</template>
<script>
import {getRightsList} from "@/api"
export default {
  data() {
    return{
      rightList:[]
    }
  },
  created(){
    // getRightsList(params:{{type:'list'}})
    getRightsList({type:'list'}).then(res=>{
      console.log(res)
      this.rightList=res.data
    })
  },
  filters:{
    fmtLevel(level){
      if (level === '0') {
        return '一级'
      } else if (level === '1') {
        return '二级'
      } else {
        return '三级'
      }
    }
  }
}
</script>
<style scoped>

</style>



